Skip to content

fix: do not overwrite user-defined process's exit code to 1#338

Open
micalevisk wants to merge 1 commit intoevanw:masterfrom
micalevisk:patch-1
Open

fix: do not overwrite user-defined process's exit code to 1#338
micalevisk wants to merge 1 commit intoevanw:masterfrom
micalevisk:patch-1

Conversation

@micalevisk
Copy link

Instead of exiting with 1 we must keep the user-land value defined for process.exitCode if it's non-zero otherwise we end up changing the error code defined by the consumer of this lib.

Code example:

// app.js
require('source-map-support').install();
process.exitCode = 123
throw new Error('test 123')

after running node app.js I'm expecting to see 123 as the exit code but I'm getting 1:

image

Instead of exiting with 1 we must keep the user-land value defined for `process.exitCode` if it's non-zero otherwise we end up changing the error code defined by the consumer of this lib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant